package com.hmall.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hmall.order.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    Long save(OrderDTO orderDTO);

    @Select("select * from tb_item where id=#{itemId}")
    Item findById(Long itemId);

    void into(OrderDetail orderDetail);

    void savein(OrderLogistics orderLogistics);

    @Select("select * from tb_order where user_id=#{userId}")
    com.hmall.common.dto.Order getByUserId(Integer userId);

    @Update("update tb_order set status='5' where user_id=#{userId}")
    void changestatus(Integer userId);
}
